package org.cancer.app

import org.apache.spark.streaming.dstream.DStream
import org.cancer.bean.HighRiskIdentificationData
import org.cancer.common.TApp
import org.cancer.controller.HighRiskIdentificationController
import org.cancer.handler.DataHandler

object HighRiskIdentificationApp_Sylvia extends TApp {
  start("local[*]", "HighRiskPatientIdentificationApp") {
    println("启动癌症高危患者识别应用...")

    val highRiskController = new HighRiskIdentificationController()

    // 从Kafka获取患者数据
    val patientDataStream: DStream[HighRiskIdentificationData] =
      DataHandler.KafkaDataHandler("BD2", "HighRiskIdentification")

    // 分发数据到处理流程
    highRiskController.dispatch(patientDataStream)

    // 启动流式处理
    DataHandler.startAndAwait()
  }
}

